const loadMoreDirective = {
  inserted(el, binding) {
    // 获取element-ui定义好的scroll盒子
    const dom = el.querySelector(
      '.el-select-dropdown .el-select-dropdown__wrap'
    )
    dom.addEventListener('scroll', function() {
      const condition =
        this.scrollHeight - this.scrollTop < this.clientHeight + 1
      console.log(this.scrollHeight - this.scrollTop, this.clientHeight + 1)
      if (condition) {
        binding.value()
      }
    })
  }
}

export default loadMoreDirective
